package com.sooth.system.role.mapper;

import com.dream.system.annotation.Mapper;
import com.dream.system.annotation.Param;
import com.dream.system.annotation.Sql;
import com.sooth.system.role.view.SysRoleVo;

import java.util.List;

@Mapper
public interface SysRoleMapper {
    @Sql("""
            SELECT
            	@*(sys_role)
            FROM
            	sys_role
            	INNER JOIN sys_user_role ON sys_user_role.role_id = sys_role.id
            WHERE
            	sys_user_role.user_id =:userId
            """)
    List<SysRoleVo> queryRoleByUserId(@Param("userId") Long userId);
}
